/*
ID:luongho3
LANG:C++
TASK:milk3
*/
#include <iostream>
#include <fstream>
#include <queue>
#include <vector>
#include <algorithm>
using namespace std;
#define MAX 21
#define CHECKED 1
struct state{
       int a;
       int b;
       int c;      
};
typedef queue<state> sQueue;
typedef vector<int> iVector;
sQueue q;
iVector result;
int label[MAX][MAX][MAX];
ifstream fin("milk3.in");
ofstream fout("milk3.out");
int bucA,bucB,bucC;
void pour(int ina,int inb,int sa,int sb,int& outa,int &outb) {
     //pour from a to b
     if (ina==0) {
        outa=ina;
        outb=inb;            
     }     
     else {
          if (sb-inb<ina) {
             outb=sb;
             outa=ina-(sb-inb);
          }
          else {
               outa=0;
               outb=inb+ina;
          }
     }
}
void try_push(int a,int b,int c) {
    if (label[a][b][c]!=CHECKED) {
       label[a][b][c]=CHECKED;
       state s;
       s.a=a;
       s.b=b;
       s.c=c;
       q.push(s);
    }    
}
main() {
       fin>>bucA>>bucB>>bucC;
       state init;
       init.a=0;
       init.b=0;
       init.c=bucC;
       q.push(init);
       label[init.a][init.b][init.c]=CHECKED;
       while (!q.empty()) {
             state s=q.front();
             q.pop();
             if (s.a==0) {
                result.push_back(s.c);            
             }
             //bfs
             int a,b,c;
             pour(s.a,s.b,bucA,bucB,a,b);
             try_push(a,b,s.c);
             pour(s.a,s.c,bucA,bucC,a,c);
             try_push(a,s.b,c);
             pour(s.b,s.c,bucB,bucC,b,c);
             try_push(s.a,b,c);
             pour(s.b,s.a,bucB,bucA,b,a);
             try_push(a,b,s.c);
             pour(s.c,s.b,bucC,bucB,c,b);
             try_push(s.a,b,c);
             pour(s.c,s.a,bucC,bucA,c,a);
             try_push(a,s.b,c);
       }
       sort(result.begin(),result.end());
       int i;
       fout<<result[0];
       for (i=1;i<result.size();++i) {
           fout<<" "<<result[i];
       }
       fout<<"\n";
       return 0;
}
